<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="en" name="language">
	<title>error</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link media="screen" href="../docutils-api.css" type="text/css" rel="stylesheet">

</head>

<body>

<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
  <input type="hidden" name="domains" value="www.graphicsmagick.org" />
  <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" />&nbsp;<input type="submit" name="sa" value="Search" /></span>
</form>
</div>


<div class="navmenu">
<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../project.html">Project</a></li>
  <li><a href="../download.html">Download</a></li>
  <li><a href="../README.html">Install</a></li>
  <li><a href="../Hg.html">Source</a></li>
  <li><a href="../NEWS.html">News</a> </li>
  <li><a href="../utilities.html">Utilities</a></li>
  <li><a href="../programming.html">Programming</a></li>
  <li><a href="../reference.html">Reference</a></li>
</ul>
</div>

<main id="error">
<h1 class="title">error</h1>
<p class="subtitle" id="error-reporting-methods">Error reporting methods</p>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#catchexception" id="id27">CatchException</a></p></li>
<li><p><a class="reference internal" href="#copyexception" id="id28">CopyException</a></p></li>
<li><p><a class="reference internal" href="#destroyexceptioninfo" id="id29">DestroyExceptionInfo</a></p></li>
<li><p><a class="reference internal" href="#getexceptioninfo" id="id30">GetExceptionInfo</a></p></li>
<li><p><a class="reference internal" href="#getlocaleexceptionmessage" id="id31">GetLocaleExceptionMessage</a></p></li>
<li><p><a class="reference internal" href="#magickerror" id="id32">MagickError</a></p></li>
<li><p><a class="reference internal" href="#magickfatalerror" id="id33">MagickFatalError</a></p></li>
<li><p><a class="reference internal" href="#magickwarning" id="id34">MagickWarning</a></p></li>
<li><p><a class="reference internal" href="#seterrorhandler" id="id35">SetErrorHandler</a></p></li>
<li><p><a class="reference internal" href="#setexceptioninfo" id="id36">SetExceptionInfo</a></p></li>
<li><p><a class="reference internal" href="#setfatalerrorhandler" id="id37">SetFatalErrorHandler</a></p></li>
<li><p><a class="reference internal" href="#setwarninghandler" id="id38">SetWarningHandler</a></p></li>
<li><p><a class="reference internal" href="#throwexception" id="id39">ThrowException</a></p></li>
<li><p><a class="reference internal" href="#throwloggedexception" id="id40">ThrowLoggedException</a></p></li>
</ul>
</div>
<section id="catchexception">
<h1><a class="toc-backref" href="#id27">CatchException</a></h1>
<section id="synopsis">
<h2>Synopsis</h2>
<pre class="literal-block">CatchException( const <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="description">
<h2>Description</h2>
<p>CatchException() returns if no exceptions is found otherwise it reports
the exception as a warning, error, or fatal depending on the severity.</p>
<p>The format of the CatchException method is:</p>
<pre class="literal-block">CatchException( const <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception info.</p>
</dd>
</dl>
</section>
</section>
<section id="copyexception">
<h1><a class="toc-backref" href="#id28">CopyException</a></h1>
<section id="id1">
<h2>Synopsis</h2>
<pre class="literal-block">void CopyException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *copy, const <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *original );</pre>
</section>
<section id="id2">
<h2>Description</h2>
<p>CopyException() copies exception data from one ExceptionInfo structure
to another.</p>
<p>The format of the CopyException method is:</p>
<pre class="literal-block">void CopyException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *copy, const <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *original );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>copy:</dt>
<dd><p>The exception to copy to.</p>
</dd>
<dt>original:</dt>
<dd><p>The exception to copy from.</p>
</dd>
</dl>
</section>
</section>
<section id="destroyexceptioninfo">
<h1><a class="toc-backref" href="#id29">DestroyExceptionInfo</a></h1>
<section id="id3">
<h2>Synopsis</h2>
<pre class="literal-block">void DestroyExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id4">
<h2>Description</h2>
<p>DestroyExceptionInfo() deallocates memory associated with exception.</p>
<p>The format of the DestroyExceptionInfo method is:</p>
<pre class="literal-block">void DestroyExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception info.</p>
</dd>
</dl>
</section>
</section>
<section id="getexceptioninfo">
<h1><a class="toc-backref" href="#id30">GetExceptionInfo</a></h1>
<section id="id5">
<h2>Synopsis</h2>
<pre class="literal-block">GetExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
</section>
<section id="id6">
<h2>Description</h2>
<p>GetExceptionInfo() initializes an exception to default values.</p>
<p>The format of the GetExceptionInfo method is:</p>
<pre class="literal-block">GetExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception info.</p>
</dd>
</dl>
</section>
</section>
<section id="getlocaleexceptionmessage">
<h1><a class="toc-backref" href="#id31">GetLocaleExceptionMessage</a></h1>
<section id="id7">
<h2>Synopsis</h2>
<pre class="literal-block">const char *GetLocaleExceptionMessage( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity, const char *tag );</pre>
</section>
<section id="id8">
<h2>Description</h2>
<p>GetLocaleExceptionMessage() converts a enumerated exception severity and tag
to a message in the current locale.</p>
<p>The format of the GetLocaleExceptionMessage method is:</p>
<pre class="literal-block">const char *GetLocaleExceptionMessage( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity, const char *tag );</pre>
<dl class="simple">
<dt>severity:</dt>
<dd><p>the severity of the exception.</p>
</dd>
<dt>tag:</dt>
<dd><p>the message tag.</p>
</dd>
</dl>
</section>
</section>
<section id="magickerror">
<h1><a class="toc-backref" href="#id32">MagickError</a></h1>
<section id="id9">
<h2>Synopsis</h2>
<pre class="literal-block">void MagickError( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> error, const char *reason, const char *description );</pre>
</section>
<section id="id10">
<h2>Description</h2>
<p>Method MagickError calls the error handler methods with an error reason.</p>
<p>The format of the MagickError method is:</p>
<pre class="literal-block">void MagickError( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> error, const char *reason, const char *description );</pre>
<dl class="simple">
<dt>exception:</dt>
<dd><p>Specifies the numeric error category.</p>
</dd>
<dt>reason:</dt>
<dd><p>Specifies the reason to display before terminating the
program.</p>
</dd>
<dt>description:</dt>
<dd><p>Specifies any description to the reason.</p>
</dd>
</dl>
</section>
</section>
<section id="magickfatalerror">
<h1><a class="toc-backref" href="#id33">MagickFatalError</a></h1>
<section id="id11">
<h2>Synopsis</h2>
<pre class="literal-block">void MagickFatalError( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> error, const char *reason,
                       const char *description );</pre>
</section>
<section id="id12">
<h2>Description</h2>
<p>MagickFatalError() calls the fatal error handler methods with an error
reason.  The fatal error handler is not expected to return!</p>
<p>The format of the MagickFatalError method is:</p>
<pre class="literal-block">void MagickFatalError( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> error, const char *reason,
                       const char *description );</pre>
<dl class="simple">
<dt>exception:</dt>
<dd><p>Specifies the numeric error category.</p>
</dd>
<dt>reason:</dt>
<dd><p>Specifies the reason to display before terminating the
program.</p>
</dd>
<dt>description:</dt>
<dd><p>Specifies any description to the reason.</p>
</dd>
</dl>
</section>
</section>
<section id="magickwarning">
<h1><a class="toc-backref" href="#id34">MagickWarning</a></h1>
<section id="id13">
<h2>Synopsis</h2>
<pre class="literal-block">void MagickWarning( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> warning, const char *reason,
                    const char *description );</pre>
</section>
<section id="id14">
<h2>Description</h2>
<p>Method MagickWarning calls the warning handler methods with a warning
reason.</p>
<p>The format of the MagickWarning method is:</p>
<pre class="literal-block">void MagickWarning( const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> warning, const char *reason,
                    const char *description );</pre>
<dl class="simple">
<dt>warning:</dt>
<dd><p>The warning severity.</p>
</dd>
<dt>reason:</dt>
<dd><p>Define the reason for the warning.</p>
</dd>
<dt>description:</dt>
<dd><p>Describe the warning.</p>
</dd>
</dl>
</section>
</section>
<section id="seterrorhandler">
<h1><a class="toc-backref" href="#id35">SetErrorHandler</a></h1>
<section id="id15">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> SetErrorHandler( <a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> handler );</pre>
</section>
<section id="id16">
<h2>Description</h2>
<p>SetErrorHandler() sets the error handler to the specified method
and returns the previous error handler.</p>
<p>The format of the SetErrorHandler method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> SetErrorHandler( <a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> handler );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>handler:</dt>
<dd><p>The method to handle errors.</p>
</dd>
</dl>
</section>
</section>
<section id="setexceptioninfo">
<h1><a class="toc-backref" href="#id36">SetExceptionInfo</a></h1>
<section id="id17">
<h2>Synopsis</h2>
<pre class="literal-block">SetExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity );</pre>
</section>
<section id="id18">
<h2>Description</h2>
<p>SetExceptionInfo() set the exception severity.</p>
<p>The format of the SetExceptionInfo method is:</p>
<pre class="literal-block">SetExceptionInfo( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception info.</p>
</dd>
<dt>severity:</dt>
<dd><p>The exception severity.</p>
</dd>
</dl>
</section>
</section>
<section id="setfatalerrorhandler">
<h1><a class="toc-backref" href="#id37">SetFatalErrorHandler</a></h1>
<section id="id19">
<h2>Synopsis</h2>
<pre class="literal-block">FatalErrorHandler SetFatalErrorHandler( FatalErrorHandler handler );</pre>
</section>
<section id="id20">
<h2>Description</h2>
<p>SetFatalErrorHandler() sets the fatal error handler to the specified method
and returns the previous fatal error handler.</p>
<p>The format of the SetFatalErrorHandler method is:</p>
<pre class="literal-block">FatalErrorHandler SetFatalErrorHandler( FatalErrorHandler handler );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>handler:</dt>
<dd><p>The method to handle errors.</p>
</dd>
</dl>
</section>
</section>
<section id="setwarninghandler">
<h1><a class="toc-backref" href="#id38">SetWarningHandler</a></h1>
<section id="id21">
<h2>Synopsis</h2>
<pre class="literal-block"><a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> SetWarningHandler( <a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> handler );</pre>
</section>
<section id="id22">
<h2>Description</h2>
<p>SetWarningHandler() sets the warning handler to the specified method
and returns the previous warning handler.</p>
<p>The format of the SetWarningHandler method is:</p>
<pre class="literal-block"><a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> SetWarningHandler( <a class="reference external" href="../api/types.html#errorhandler">ErrorHandler</a> handler );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>handler:</dt>
<dd><p>The method to handle warnings.</p>
</dd>
</dl>
</section>
</section>
<section id="throwexception">
<h1><a class="toc-backref" href="#id39">ThrowException</a></h1>
<section id="id23">
<h2>Synopsis</h2>
<pre class="literal-block">void ThrowException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity,
                     const char *reason, const char *description );</pre>
</section>
<section id="id24">
<h2>Description</h2>
<p>ThrowException() throws an exception with the specified severity code,
reason, and optional description.</p>
<p>The format of the ThrowException method is:</p>
<pre class="literal-block">void ThrowException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity,
                     const char *reason, const char *description );</pre>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception.</p>
</dd>
<dt>severity:</dt>
<dd><p>The severity of the exception.</p>
</dd>
<dt>reason:</dt>
<dd><p>The reason of the exception.</p>
</dd>
<dt>description:</dt>
<dd><p>The exception description.</p>
</dd>
</dl>
</section>
</section>
<section id="throwloggedexception">
<h1><a class="toc-backref" href="#id40">ThrowLoggedException</a></h1>
<section id="id25">
<h2>Synopsis</h2>
<pre class="literal-block">void ThrowLoggedException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity,
                           const char *reason, const char *description, const char *module,
                           const char *function, const unsigned long line ;</pre>
</section>
<section id="id26">
<h2>Description</h2>
<p>ThrowLoggedException() throws an exception with the specified severity code,
reason, optional description, source filename, function name, and line
number. If logging is enabled, the exception is also logged.</p>
<p>If the exception already contains an ErrorException (or greater) or the
existing exception is more severe, then it is ignored.</p>
<p>The format of the ThrowLoggedException method is:</p>
<pre class="literal-block">void ThrowLoggedException( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception, const <a class="reference external" href="../api/types.html#exceptiontype">ExceptionType</a> severity,
                           const char *reason, const char *description, const char *module,
                           const char *function, const unsigned long line ;</pre>
<dl class="simple">
<dt>exception:</dt>
<dd><p>The exception.</p>
</dd>
<dt>severity:</dt>
<dd><p>The severity of the exception.</p>
</dd>
<dt>reason:</dt>
<dd><p>The reason of the exception.</p>
</dd>
<dt>description:</dt>
<dd><p>The exception description.</p>
</dd>
<dt>filename:</dt>
<dd><p>The source module filename.</p>
</dd>
<dt>function:</dt>
<dd><p>The function name.</p>
</dd>
<dt>line:</dt>
<dd><p>The line number of the source module.</p>
</dd>
</dl>
</section>
</section>
</main>


<hr class="docutils">
<div class="document">
    <p><a href="../Copyright.html">Copyright</a> © GraphicsMagick Group 2002-2025<!--SPONSOR_LOGO--></p>
</div>

</main>
</body>
</html>
